﻿using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using TiaoTiaoCode.AutoUpdate.ServerUI.ViewModels;

namespace TiaoTiaoCode.AutoUpdate.ServerUI.Views
{
    /// <summary>
    /// 上传更新包界面
    /// </summary>
    public partial class UploadPublishZipView : UserControl
    {
        public UploadPublishZipView()
        {
            InitializeComponent();
        }

        private void BtnOpenFileDialog(object sender, RoutedEventArgs e)
        {
            var of = new OpenFileDialog
            {
                Filter = "更新包|*.zip"
            };

            bool? dr = of.ShowDialog();

            if (dr == null || !(bool)dr) return;

            if (!(DataContext is UploadPublishZipViewModel vm)) return;
            vm.ZipFile = of.FileName;
        }
    }
}
